<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	template="../../layout/commonLayout.xhtml">
	<ui:define name="head">
                BIDI BIDI
                </ui:define>
	<ui:define name="content">
		<p:outputPanel id="mainPanel">
			<p:messages globalOnly="true" />
			<p:panel id="panel1"
				rendered="#{publishBasicBean.state == 0 or publishBasicBean.state == 1 or publishBasicBean.state == 2 or publishBasicBean.state == 3}">
				<h:form id="publishForm">
					<p:panel id="publishPanel">
						<h:outputLabel style="font-weight:bold;color:blue">Publish Name : </h:outputLabel>
						<h:outputText value=" " />
						<p:inputText id="publishName"
							value="#{publishBasicBean.publishName}" size="30" />
						<p:message for="publishName" id="publishNameMessage" />
					</p:panel>
					<p:panel>
						<h:outputLabel style="font-weight:bold;color:blue">Route Address : </h:outputLabel>
						<h:outputText value=" " />
						<p:inputText id="routeURL" value="#{publishBasicBean.routeURL}"
							size="30" />
						<p:message for="routeURL" id="routeAddressMessage" />
					</p:panel>
					<p:panel>
						<h:outputLabel style="font-weight:bold;color:blue">Request Path : </h:outputLabel>
						<h:outputText value=" /route/ " />
						<p:inputText id="requestPath"
							value="#{publishBasicBean.requestPath}" size="30" />
						<p:message for="requestPath" id="requestPathMessage" />
					</p:panel>
					<p:panel>
						<p:commandButton action="#{publishBasicBean.checkURL}"
							value="Next" update="mainPanel" />
					</p:panel>
				</h:form>
			</p:panel>
			<p:dialog rendered="#{publishBasicBean.state == 2}" visible="true"
				closeOnEscape="false" onCloseUpdate="mainPanel" draggable="false"
				modal="true" resizable="false" widgetVar="sslDialog" width="640">
				<p:panel>
					<h:outputLabel>This certificate is not in truststore. Do you want to add?</h:outputLabel>
				</p:panel>
				<p:outputPanel>
					<h:outputLabel value="Issued To : "
						style="font-weight:bold;color:blue" />
					<h:outputLabel value="#{publishBasicBean.certificateInfo.issuedTo}" />
					<br />
					<h:outputLabel value="Issued By : "
						style="font-weight:bold;color:blue" />
					<h:outputLabel value="#{publishBasicBean.certificateInfo.issuedBy}" />
					<br />
					<h:outputLabel value="Valid From "
						style="font-weight:bold;color:blue" />
					<h:outputLabel
						value="#{publishBasicBean.certificateInfo.notBefore}" />
					<h:outputLabel value=" To " style="font-weight:bold;color:blue" />
					<h:outputLabel value="#{publishBasicBean.certificateInfo.notAfter}" />
					<br />
				</p:outputPanel>
				<p:panel>
					<h:form>
						<p:commandButton
							action="#{publishBasicBean.addCertificaToTrustStore}" value="Yes"
							oncomplete="sslDialog.hide()" />
						<p:commandButton action="#{publishBasicBean.cancelAddCertificate}"
							value="No" oncomplete="sslDialog.hide()" />
					</h:form>
				</p:panel>
			</p:dialog>
			<p:dialog rendered="#{publishBasicBean.state == 3}" visible="true"
				closeOnEscape="false" onCloseUpdate="mainPanel" draggable="false"
				modal="true" resizable="false" widgetVar="basicAuthDialog"
				width="640">
				<p:panel>
					<h:outputLabel>You must enter valid password to enter this resource.</h:outputLabel>
				</p:panel>
				<h:form>
					<p:outputPanel>
						<h:outputLabel value="Username : "
							style="font-weight:bold;color:blue" />
						<p:inputText value="#{publishBasicBean.username}" size="30" />
						<br />
						<h:outputLabel value="Password : "
							style="font-weight:bold;color:blue" />
						<p:password value="#{publishBasicBean.password}" size="30" />
						<br />
					</p:outputPanel>
					<p:panel>
						<p:commandButton action="#{publishBasicBean.basicAuthCheckURL}"
							update="mainPanel" value="Yes"
							oncomplete="basicAuthDialog.hide()" />
						<p:commandButton type="button" value="Cancel"
							oncomplete="basicAuthDialog.hide()" />
					</p:panel>
				</h:form>
			</p:dialog>
			<p:panel id="panel5" rendered="#{publishBasicBean.state == 4}">
				<h:form>
					<h:selectBooleanCheckbox value="#{publishBasicBean.postAvaiable}"/><h:outputText>POST</h:outputText>
					<br />
					<h:selectBooleanCheckbox value="#{publishBasicBean.getAvaiable}"/><h:outputText>GET</h:outputText>
					<br />

					<p:panel>
						<p:commandButton action="#{publishBasicBean.setConfiguration}"
							value="Finish" update="mainPanel" />
					</p:panel>
				</h:form>
			</p:panel>
		</p:outputPanel>



	</ui:define>
</ui:composition>
